-- UNITDEF -- kawnair_iv --
--------------------------------------------------------------------------------

local unitName = "kawnair_iv"

--------------------------------------------------------------------------------

unitDef = {
  unitname            = [[kawnair_iv]],
  name                = [[Adv Ju Jak Gunship VTOL]],
  description         = [[Air Support Lv 4]],
  acceleration        = 0.5,
  amphibious          = false,
  bankscale           = [[0.2]], ---was 1.0
  bmcode              = [[1]],
  brakeRate           = 0.5,
  buildCostEnergy     = 0,
  buildCostMetal      = 0,
  builder             = false,
  buildTime           = 0,
  canAttack           = true,
  canFly              = true,
  canFireControl      = 1,
  canGuard            = true,
  canMove             = true,
  canPatrol           = true,
  canstop             = [[1]],
  canSubmerge         = false,
  category            = [[AIR NOTINF TARGET]],
  collide             = true,
  cruiseAlt           = 200,
  defaultmissiontype  = [[VTOL_standby]],
  drag		  		  = 1.0, --- was 0.05
  explodeAs           = [[death]],
  floater             = true,
  footprintX          = 1,
  footprintZ          = 1,
  hoverAttack         = true,
  iconType            = [[av]],
  idleAutoHeal        = 5,
  idleTime            = 300,
  maneuverleashlength = [[1280]],
  mass                = 4000,
  maxDamage           = 338,
  ---maxFuel             = 250, can add when have a refueler
  maxVelocity         = 8,
  MaxWaterDepth 	    = 1,
  noAutoFire          = false,
  noChaseCategory     = [[AIR NOTARGET]],
  objectName          = [[kawnair_iv.s3o]],
  scale               = [[1.0]],
  seismicSignature    = 0,
  selfDestructAs      = [[DEATH]],

  sfxtypes            = {

    explosiongenerators = {
 [[custom:flashmuzzle1]],  --muuzzle?
 [[custom:flashmuzzle0]],
 [[custom:missileshot]],
    },

  },

  side                = [[AI]],
  sightDistance       = 800,
  smoothAnim          = true,
  steeringmode        = [[1]],
  TEDClass            = [[VTOL]],
  turnRate            = 792,
  workerTime          = 0,

  weapons             = {

    {
    def                = [[aivwep1]],
	badTargetCategory  = [[NOTARGET AIR]],
    mainDir            = [[0 -0.35 1]],
    maxAngleDif        = 30,
    onlyTargetCategory = [[NOTAIR TARGET]],
    },

 {
    def                = [[aivwep2]],
	badTargetCategory  = [[NOTARGET AIR BASE]],
	--  fuelUsage          = 100,
    mainDir            = [[0 0 1]],
    maxAngleDif        = 90,
    onlyTargetCategory = [[NOTAIR TARGET]],
    },

  },

  weaponDefs          = {

    AIVWEP1 = {
	id                 = 4,
	avoidFriendly      = false,
    burst              = 7,
    burstrate          = 0.1,
    collideFriendly    = false,
    craterBoost        = 0,
    craterMult         = 0,
    duration           = .05,
    explosionGenerator = [[custom:none]],
    id                 = 1,
    impactonly         = 1,
    impulseBoost       = 0,
    impulseFactor      = 0,
    name               = [[Auto Cannon]],
    range              = 599,
    reloadtime         = 1.5, --normal 3 but 1/2 damage
    rgbColor                = [[.8 1 0.4]],
	texture1 = [[bullet]],
	texture2 = [[bullet]],
	texture3 = [[bullet]],
	size = 4;
    soundStart         = [[gunfire]],
    sprayAngle         = 800,
	thickness		   = 2,
    thickness          = 4,
    tolerance          = 1000,
    turret             = true,
    weaponType         = [[LaserCannon]],
    weaponVelocity     = 1000,
	InterceptedByShieldType = 2,
    damage = {
      default            = 6.8, --dp3s is 47.5
    },
  },

AIVWEP2 = {
      id = 3,
      name                    = [[Air to Surface Rocket]],
      areaOfEffect            = 40,
 	  burst                   = 4,
      burstrate               = 0.8,
	  craterBoost             = 1,
      craterMult              = 1,

      damage                  = {
        default = 5,
		base = 1,
      },

      explosionGenerator      = [[custom:MISSILE_EXPLOSION]], -- was FLASH2 
      fireStarter             = 70,
      flightTime              = 3,
      impactOnly              = true,
      impulseBoost            = 0,
      impulseFactor           = 0.4,
      InterceptedByShieldType = 2,
      lineOfSight             = true,
      metalpershot            = 0,
      model                   = [[srocket.s3o]],
      noSelfDamage            = true,
      range                   = 659,
      reloadtime              = 8,
      renderType              = 1,
      selfprop                = true,
      smokedelay              = [[0.1]],
      smokeTrail              = true,
      soundHit                = [[Rocket]],
      soundStart              = [[smallexplo]],
      startsmoke              = [[1]],
      startVelocity           = 400,
      tolerance               = 10000,
      turret                  = true,
      weaponAcceleration      = 100,
      weaponTimer             = 5,
      weaponType              = [[MissileLauncher]],
      weaponVelocity          = 350,
    },
 },

featureDefs         = {
  },

 }

--------------------------------------------------------------------------------

return lowerkeys({ [unitName] = unitDef })

--------------------------------------------------------------------------------
